package com.itheima.job;

import com.itheima.utils.ZKSelectMasterUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by 传智播客*黑马程序员.
 */
@Configuration
public class ZkConfig {

    @Autowired
    private SystemParamProperties systemParamProperties;

    @Bean
    public ZKSelectMasterUtil zkSelectMasterUtil(){
        ZKSelectMasterUtil zkSelectMasterUtil = new ZKSelectMasterUtil();
        zkSelectMasterUtil.setZkAddress(systemParamProperties.getZkAddr());
        return zkSelectMasterUtil;
    }
}
